<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">	
<link href="<c:url value="/resources/css/table.css"/>"
type="text/css" rel="stylesheet"  />
<title>Insert title here</title>
</head>
<body>
<div class="box1">
<div class="row">
<div class="col-md-12">


<center><h2 class="text-center">Employee List</h2>  </center>
    <table cellpadding="3px" cellspacing="3px" class="table-striped table-hover" id="EmplTablee">
    <tr>
    <th><small>Id</small></th>
     <th><small>Name</small></th>
        <th><small>IC</small></th>
        <th><small>Contact</small></th>
        <th><small>Address</small></th>
        <th><small>email</small></th>
        <th><small>Depart</small></th>
        <th><small>Design</small></th>
        <th><small>MngID</small></th>
        <th><small>Action</small></th>
        <th><small>Edit</small></th>
       </tr> 
 <c:forEach var="users" items="${UsersList}">
<tr>
<td><h6>${users.id}</h6></td>
<td><h6>${users.name}</h6></td>
<td><h6>${users.ic}</h6></td>
<td><h6>${users.contact}</h6></td>
<td><h6>${users.address}</h6></td>
<td><h6>${users.email}</h6></td>
<td><h6>${users.department}</h6></td>
<td><h6>${users.designation}</h6></td>
<td><h6>${users.managerId}</h6></td>
<td> <form action="${pageContext.request.contextPath}/adminHome/EmpList/delete/${users.id}" method="POST">
        <input type="submit" value="delete" name="delete" class="btn btn-sm btn-danger" />
         </form>
  </td>
<td> <form action="${pageContext.request.contextPath}/adminHome/EmpList/edit/${users.id}" method="GET">
        <input type="submit" value="edit" name="edit" class="btn btn-sm btn-warning" />     
         </form></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
<table align="center">
<tr>
<c:forEach var="page" items="${noOfPages}">
<td>
<form action="EmpList" method="POST" name="someForm">  
<spring:url value="EmpList?pageNo={pageNo}" var="pageUrl">
<spring:param name="pageNo" value="${page.key}" />
</spring:url> 
<a href="${pageUrl}" onclick="document.someForm.submit();">
<c:if test="${currentNO eq page.key }">
<strong><c:out value="  ${page.key+1}  "/></strong>
</c:if>
<c:if test="${currentNO ne page.key }">
<c:out value="  ${page.key+1}  "/>
</c:if>
</a>
</form>
</td>
</c:forEach>
</tr>
</table>
<div class="row" align="center">
         <form action="${pageContext.request.contextPath}/adminHome/EmpList/create"  method="GET"  >
        <input type="submit" class="btn btn-default" value="create" name="create"/>
        </form>
        </div>
    
</body>
</html>